package com.charm.codes.widget.dialog;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.WindowManager;

import com.afollestad.materialdialogs.MaterialDialog;
import com.charm.codes.R;

/**
 * @author tools
 * @date 2017/12/25
 */

public class LoadingDialogHelper {
    public static MaterialDialog getLoadingDialog(Context context) {
        MaterialDialog.Builder builder = new MaterialDialog.Builder(context);
        builder.customView(R.layout.layout_loading_dialog, false);
        MaterialDialog materialDialog = builder.build();
        WindowManager.LayoutParams params = materialDialog.getWindow().getAttributes();
        params.width = 550;
        params.height = 500;
        params.alpha = 1.0f;
        params.dimAmount = 0.0f;
        materialDialog.getWindow().setAttributes(params);
        return materialDialog;
    }
}
